/*
 * @Description: 获取粉丝数
 * @Author: 学渣小宝
 * @Date: 2021-03-31 07:28:35
 * @LastEditors: 学渣小宝
 * @LastEditTime: 2021-03-31 21:45:26
 */

'use strict';

const Controller = require('egg').Controller;

class ServiceController extends Controller {
  async getUserService() {
    const { user_name, page, per_page } = this.ctx.query;
    const res = await this.service.githubService.getFollowers(user_name, page, per_page);
    this.ctx.body = res;
  }
  async githubHbs() {
    const { ctx } = this;
    const githubData = await ctx.service.githubService.getFollowers();
    await ctx.render('githubInfo.hbs', { githubData });
  }
  async githubEjs() {
    const { ctx } = this;
    const githubData = await ctx.service.githubService.getFollowers();
    await ctx.render('githubInfo.ejs', { githubData });
  }
  async githubNj() {
    const { ctx } = this;
    const githubData = await ctx.service.githubService.getFollowers();
    await ctx.render('githubInfo.nj', { githubData });
  }
}

module.exports = ServiceController;

